package com.worker.Singleton;

/**
 * 我是国王，肯定是独一无二的呀
 * @author worker
 *
 */
public class King {
   private static final King king = new King();
   //不允许在其他地方调用
   private King() {
   }
   //确保他是独一无二的，其实多线程拜访
   public synchronized static King getKing() {
	   System.out.println("我还是那个国王");
	   return king;
   } 
}
